/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package view;

import javax.swing.JPanel;

/**
 *
 * @author lOaD
 */
public class Principal extends javax.swing.JFrame {

    /**
     * Creates new form Principal
     */
    public Principal() {
        initComponents();
        PanelInicio panelInicio = new PanelInicio();
        setPanel(panelInicio);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        PanelPrincipal = new javax.swing.JPanel();
        jToolBar1 = new javax.swing.JToolBar();
        btmm1 = new javax.swing.JButton();
        btmg1 = new javax.swing.JButton();
        btgg1 = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setPreferredSize(new java.awt.Dimension(800, 500));

        PanelPrincipal.setLayout(new java.awt.BorderLayout());

        jToolBar1.setRollover(true);

        btmm1.setText("M/M/1");
        btmm1.setFocusable(false);
        btmm1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btmm1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btmm1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                btmm1MouseClicked(evt);
            }
        });
        btmm1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btmm1ActionPerformed(evt);
            }
        });
        jToolBar1.add(btmm1);

        btmg1.setText("M/G/1");
        btmg1.setFocusable(false);
        btmg1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btmg1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btmg1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btmg1ActionPerformed(evt);
            }
        });
        jToolBar1.add(btmg1);

        btgg1.setText("G/G/1");
        btgg1.setFocusable(false);
        btgg1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btgg1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btgg1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btgg1ActionPerformed(evt);
            }
        });
        jToolBar1.add(btgg1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(PanelPrincipal, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jToolBar1, javax.swing.GroupLayout.DEFAULT_SIZE, 780, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(PanelPrincipal, javax.swing.GroupLayout.DEFAULT_SIZE, 446, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btmm1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btmm1ActionPerformed
        PanelMm1 panelMm1 = new PanelMm1();
        setPanel(panelMm1);
    }//GEN-LAST:event_btmm1ActionPerformed

    private void btmm1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btmm1MouseClicked
        // TODO add your handling code here:
    }//GEN-LAST:event_btmm1MouseClicked

    private void btgg1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btgg1ActionPerformed
      PanelGg1 panelGg1 = new PanelGg1();
        setPanel(panelGg1); 
    }//GEN-LAST:event_btgg1ActionPerformed

    private void btmg1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btmg1ActionPerformed
      PanelMg1 panelMg1 = new PanelMg1();
        setPanel(panelMg1); 
    }//GEN-LAST:event_btmg1ActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new Principal().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel PanelPrincipal;
    private javax.swing.JButton btgg1;
    private javax.swing.JButton btmg1;
    private javax.swing.JButton btmm1;
    private javax.swing.JToolBar jToolBar1;
    // End of variables declaration//GEN-END:variables

    private void setPanel(JPanel panel) {
        PanelPrincipal.setVisible(false);
        PanelPrincipal.removeAll();
        PanelPrincipal.add(panel);
        PanelPrincipal.setVisible(true);
    }
}
